/** @type {import('@rspack/test-tools').TStatsAPICaseConfig} */
module.exports = {
	description: "should output stats with query",
	options(context) {
		return {
			context: context.getSource(),
			entry: "./fixtures/abc-query"
		};
	},
	async check(stats) {
		const statsOptions = {
			all: true,
			timings: false,
			builtAt: false,
			version: false
		};
		expect(stats?.toJson(statsOptions)).toMatchInlineSnapshot(`
			Object {
			  assets: Array [
			    Object {
			      auxiliaryChunkIdHints: Array [],
			      auxiliaryChunkNames: Array [],
			      auxiliaryChunks: Array [],
			      cached: false,
			      chunkIdHints: Array [],
			      chunkNames: Array [
			        main,
			      ],
			      chunks: Array [
			        889,
			      ],
			      emitted: true,
			      filteredRelated: 0,
			      info: Object {
			        chunkhash: Array [],
			        contenthash: Array [],
			        fullhash: Array [],
			        isOverSizeLimit: false,
			        javascriptModule: false,
			        minimized: true,
			        related: Object {},
			      },
			      isOverSizeLimit: false,
			      name: main.js,
			      related: Array [],
			      size: 337,
			      type: asset,
			    },
			  ],
			  assetsByChunkName: Object {
			    main: Array [
			      main.js,
			    ],
			  },
			  children: Array [],
			  chunks: Array [
			    Object {
			      auxiliaryFiles: Array [],
			      children: Array [],
			      childrenByOrder: Object {},
			      entry: true,
			      files: Array [
			        main.js,
			      ],
			      filteredModules: undefined,
			      hash: 9bea9c1d738ecf47,
			      id: 889,
			      idHints: Array [],
			      initial: true,
			      modules: Array [
			        Object {
			          assets: Array [],
			          buildTimeExecuted: false,
			          built: true,
			          cacheable: true,
			          cached: false,
			          chunks: Array [
			            889,
			          ],
			          codeGenerated: true,
			          dependent: true,
			          depth: 2,
			          errors: 0,
			          failed: false,
			          filteredReasons: undefined,
			          id: 195,
			          identifier: <TEST_ROOT>/fixtures/a.js,
			          index: 3,
			          index2: 1,
			          issuer: <TEST_ROOT>/fixtures/c.js?c=3,
			          issuerId: 679,
			          issuerName: ./fixtures/c.js?c=3,
			          issuerPath: Array [
			            Object {
			              id: 305,
			              identifier: <TEST_ROOT>/fixtures/abc-query.js,
			              name: ./fixtures/abc-query.js,
			            },
			            Object {
			              id: 679,
			              identifier: <TEST_ROOT>/fixtures/c.js?c=3,
			              name: ./fixtures/c.js?c=3,
			            },
			          ],
			          layer: undefined,
			          moduleType: javascript/auto,
			          name: ./fixtures/a.js,
			          nameForCondition: <TEST_ROOT>/fixtures/a.js,
			          optimizationBailout: Array [
			            Statement with side_effects in source code at ./fixtures/a.js<LINE_COL_RANGE>,
			            ModuleConcatenation bailout: Module is not an ECMAScript module,
			          ],
			          optional: false,
			          orphan: false,
			          postOrderIndex: 1,
			          preOrderIndex: 3,
			          providedExports: null,
			          reasons: Array [
			            Object {
			              active: true,
			              explanation: undefined,
			              loc: undefined,
			              moduleId: 195,
			              moduleIdentifier: <TEST_ROOT>/fixtures/a.js,
			              moduleName: ./fixtures/a.js,
			              resolvedModule: ./fixtures/a.js,
			              resolvedModuleId: 195,
			              resolvedModuleIdentifier: <TEST_ROOT>/fixtures/a.js,
			              type: cjs self exports reference,
			              userRequest: self,
			            },
			            Object {
			              active: true,
			              explanation: undefined,
			              loc: 2:12-17,
			              moduleId: 679,
			              moduleIdentifier: <TEST_ROOT>/fixtures/c.js?c=3,
			              moduleName: ./fixtures/c.js?c=3,
			              resolvedModule: ./fixtures/c.js?c=3,
			              resolvedModuleId: 679,
			              resolvedModuleIdentifier: <TEST_ROOT>/fixtures/c.js?c=3,
			              type: cjs require,
			              userRequest: ./a,
			            },
			          ],
			          size: 55,
			          sizes: Object {
			            javascript: 55,
			          },
			          source: module.exports = function a() {
				return "This is a";
			};,
			          type: module,
			          usedExports: null,
			          warnings: 0,
			        },
			        Object {
			          assets: Array [],
			          buildTimeExecuted: false,
			          built: true,
			          cacheable: true,
			          cached: false,
			          chunks: Array [
			            889,
			          ],
			          codeGenerated: true,
			          dependent: true,
			          depth: 1,
			          errors: 0,
			          failed: false,
			          filteredReasons: undefined,
			          id: 133,
			          identifier: <TEST_ROOT>/fixtures/a.js?a=1,
			          index: 1,
			          index2: 0,
			          issuer: <TEST_ROOT>/fixtures/abc-query.js,
			          issuerId: 305,
			          issuerName: ./fixtures/abc-query.js,
			          issuerPath: Array [
			            Object {
			              id: 305,
			              identifier: <TEST_ROOT>/fixtures/abc-query.js,
			              name: ./fixtures/abc-query.js,
			            },
			          ],
			          layer: undefined,
			          moduleType: javascript/auto,
			          name: ./fixtures/a.js?a=1,
			          nameForCondition: <TEST_ROOT>/fixtures/a.js,
			          optimizationBailout: Array [
			            Statement with side_effects in source code at ./fixtures/a.js?a=1<LINE_COL_RANGE>,
			            ModuleConcatenation bailout: Module is not an ECMAScript module,
			          ],
			          optional: false,
			          orphan: false,
			          postOrderIndex: 0,
			          preOrderIndex: 1,
			          providedExports: null,
			          reasons: Array [
			            Object {
			              active: true,
			              explanation: undefined,
			              loc: undefined,
			              moduleId: 133,
			              moduleIdentifier: <TEST_ROOT>/fixtures/a.js?a=1,
			              moduleName: ./fixtures/a.js?a=1,
			              resolvedModule: ./fixtures/a.js?a=1,
			              resolvedModuleId: 133,
			              resolvedModuleIdentifier: <TEST_ROOT>/fixtures/a.js?a=1,
			              type: cjs self exports reference,
			              userRequest: self,
			            },
			            Object {
			              active: true,
			              explanation: undefined,
			              loc: undefined,
			              moduleId: 305,
			              moduleIdentifier: <TEST_ROOT>/fixtures/abc-query.js,
			              moduleName: ./fixtures/abc-query.js,
			              resolvedModule: ./fixtures/abc-query.js,
			              resolvedModuleId: 305,
			              resolvedModuleIdentifier: <TEST_ROOT>/fixtures/abc-query.js,
			              type: cjs export require,
			              userRequest: ./a?a=1,
			            },
			          ],
			          size: 55,
			          sizes: Object {
			            javascript: 55,
			          },
			          source: module.exports = function a() {
				return "This is a";
			};,
			          type: module,
			          usedExports: null,
			          warnings: 0,
			        },
			        Object {
			          assets: Array [],
			          buildTimeExecuted: false,
			          built: true,
			          cacheable: true,
			          cached: false,
			          chunks: Array [
			            889,
			          ],
			          codeGenerated: true,
			          dependent: false,
			          depth: 0,
			          errors: 0,
			          failed: false,
			          filteredReasons: undefined,
			          id: 305,
			          identifier: <TEST_ROOT>/fixtures/abc-query.js,
			          index: 0,
			          index2: 3,
			          issuer: undefined,
			          issuerId: undefined,
			          issuerName: undefined,
			          issuerPath: undefined,
			          layer: undefined,
			          moduleType: javascript/auto,
			          name: ./fixtures/abc-query.js,
			          nameForCondition: <TEST_ROOT>/fixtures/abc-query.js,
			          optimizationBailout: Array [
			            Statement with side_effects in source code at ./fixtures/abc-query.js<LINE_COL>-31,
			            ModuleConcatenation bailout: Module is not an ECMAScript module,
			          ],
			          optional: false,
			          orphan: false,
			          postOrderIndex: 3,
			          preOrderIndex: 0,
			          providedExports: Array [
			            a,
			            c,
			          ],
			          reasons: Array [
			            Object {
			              active: true,
			              explanation: undefined,
			              loc: undefined,
			              moduleId: null,
			              resolvedModuleId: null,
			              type: entry,
			              userRequest: ./fixtures/abc-query,
			            },
			          ],
			          size: 99,
			          sizes: Object {
			            javascript: 99,
			          },
			          source: exports.a = require("./a?a=1");
			// exports.b = require("./b?b=2");
			exports.c = require("./c?c=3");,
			          type: module,
			          usedExports: Array [],
			          warnings: 0,
			        },
			        Object {
			          assets: Array [],
			          buildTimeExecuted: false,
			          built: true,
			          cacheable: true,
			          cached: false,
			          chunks: Array [
			            889,
			          ],
			          codeGenerated: true,
			          dependent: true,
			          depth: 1,
			          errors: 0,
			          failed: false,
			          filteredReasons: undefined,
			          id: 679,
			          identifier: <TEST_ROOT>/fixtures/c.js?c=3,
			          index: 2,
			          index2: 2,
			          issuer: <TEST_ROOT>/fixtures/abc-query.js,
			          issuerId: 305,
			          issuerName: ./fixtures/abc-query.js,
			          issuerPath: Array [
			            Object {
			              id: 305,
			              identifier: <TEST_ROOT>/fixtures/abc-query.js,
			              name: ./fixtures/abc-query.js,
			            },
			          ],
			          layer: undefined,
			          moduleType: javascript/auto,
			          name: ./fixtures/c.js?c=3,
			          nameForCondition: <TEST_ROOT>/fixtures/c.js,
			          optimizationBailout: Array [
			            Statement with side_effects in source code at ./fixtures/c.js?c=3<LINE_COL_RANGE>,
			            ModuleConcatenation bailout: Module is not an ECMAScript module,
			          ],
			          optional: false,
			          orphan: false,
			          postOrderIndex: 2,
			          preOrderIndex: 2,
			          providedExports: null,
			          reasons: Array [
			            Object {
			              active: true,
			              explanation: undefined,
			              loc: undefined,
			              moduleId: 305,
			              moduleIdentifier: <TEST_ROOT>/fixtures/abc-query.js,
			              moduleName: ./fixtures/abc-query.js,
			              resolvedModule: ./fixtures/abc-query.js,
			              resolvedModuleId: 305,
			              resolvedModuleIdentifier: <TEST_ROOT>/fixtures/abc-query.js,
			              type: cjs export require,
			              userRequest: ./c?c=3,
			            },
			            Object {
			              active: true,
			              explanation: undefined,
			              loc: undefined,
			              moduleId: 679,
			              moduleIdentifier: <TEST_ROOT>/fixtures/c.js?c=3,
			              moduleName: ./fixtures/c.js?c=3,
			              resolvedModule: ./fixtures/c.js?c=3,
			              resolvedModuleId: 679,
			              resolvedModuleIdentifier: <TEST_ROOT>/fixtures/c.js?c=3,
			              type: cjs self exports reference,
			              userRequest: self,
			            },
			          ],
			          size: 72,
			          sizes: Object {
			            javascript: 72,
			          },
			          source: module.exports = function b() {
				require("./a");
				return "This is c";
			};,
			          type: module,
			          usedExports: null,
			          warnings: 0,
			        },
			      ],
			      names: Array [
			        main,
			      ],
			      origins: Array [
			        Object {
			          loc: main,
			          module: ,
			          moduleId: undefined,
			          moduleIdentifier: ,
			          moduleName: ,
			          request: ./fixtures/abc-query,
			        },
			      ],
			      parents: Array [],
			      reason: undefined,
			      rendered: true,
			      runtime: Array [
			        main,
			      ],
			      siblings: Array [],
			      size: 281,
			      sizes: Object {
			        javascript: 281,
			      },
			      type: chunk,
			    },
			  ],
			  entrypoints: Object {
			    main: Object {
			      assets: Array [
			        Object {
			          name: main.js,
			          size: 337,
			        },
			      ],
			      assetsSize: 337,
			      auxiliaryAssets: Array [],
			      auxiliaryAssetsSize: 0,
			      childAssets: Object {},
			      children: Object {},
			      chunks: Array [
			        889,
			      ],
			      filteredAssets: 0,
			      isOverSizeLimit: false,
			      name: main,
			    },
			  },
			  env: undefined,
			  errors: Array [],
			  errorsCount: 0,
			  filteredAssets: undefined,
			  filteredModules: undefined,
			  hash: e9467d49726ee933,
			  modules: Array [
			    Object {
			      assets: Array [],
			      buildTimeExecuted: false,
			      built: true,
			      cacheable: true,
			      cached: false,
			      chunks: Array [
			        889,
			      ],
			      codeGenerated: true,
			      dependent: undefined,
			      depth: 0,
			      errors: 0,
			      failed: false,
			      filteredReasons: undefined,
			      id: 305,
			      identifier: <TEST_ROOT>/fixtures/abc-query.js,
			      index: 0,
			      index2: 3,
			      issuer: undefined,
			      issuerId: undefined,
			      issuerName: undefined,
			      issuerPath: undefined,
			      layer: undefined,
			      moduleType: javascript/auto,
			      name: ./fixtures/abc-query.js,
			      nameForCondition: <TEST_ROOT>/fixtures/abc-query.js,
			      optimizationBailout: Array [
			        Statement with side_effects in source code at ./fixtures/abc-query.js<LINE_COL>-31,
			        ModuleConcatenation bailout: Module is not an ECMAScript module,
			      ],
			      optional: false,
			      orphan: false,
			      postOrderIndex: 3,
			      preOrderIndex: 0,
			      providedExports: Array [
			        a,
			        c,
			      ],
			      reasons: Array [
			        Object {
			          active: true,
			          explanation: undefined,
			          loc: undefined,
			          moduleId: null,
			          resolvedModuleId: null,
			          type: entry,
			          userRequest: ./fixtures/abc-query,
			        },
			      ],
			      size: 99,
			      sizes: Object {
			        javascript: 99,
			      },
			      source: exports.a = require("./a?a=1");
			// exports.b = require("./b?b=2");
			exports.c = require("./c?c=3");,
			      type: module,
			      usedExports: Array [],
			      warnings: 0,
			    },
			    Object {
			      assets: Array [],
			      buildTimeExecuted: false,
			      built: true,
			      cacheable: true,
			      cached: false,
			      chunks: Array [
			        889,
			      ],
			      codeGenerated: true,
			      dependent: undefined,
			      depth: 1,
			      errors: 0,
			      failed: false,
			      filteredReasons: undefined,
			      id: 133,
			      identifier: <TEST_ROOT>/fixtures/a.js?a=1,
			      index: 1,
			      index2: 0,
			      issuer: <TEST_ROOT>/fixtures/abc-query.js,
			      issuerId: 305,
			      issuerName: ./fixtures/abc-query.js,
			      issuerPath: Array [
			        Object {
			          id: 305,
			          identifier: <TEST_ROOT>/fixtures/abc-query.js,
			          name: ./fixtures/abc-query.js,
			        },
			      ],
			      layer: undefined,
			      moduleType: javascript/auto,
			      name: ./fixtures/a.js?a=1,
			      nameForCondition: <TEST_ROOT>/fixtures/a.js,
			      optimizationBailout: Array [
			        Statement with side_effects in source code at ./fixtures/a.js?a=1<LINE_COL_RANGE>,
			        ModuleConcatenation bailout: Module is not an ECMAScript module,
			      ],
			      optional: false,
			      orphan: false,
			      postOrderIndex: 0,
			      preOrderIndex: 1,
			      providedExports: null,
			      reasons: Array [
			        Object {
			          active: true,
			          explanation: undefined,
			          loc: undefined,
			          moduleId: 133,
			          moduleIdentifier: <TEST_ROOT>/fixtures/a.js?a=1,
			          moduleName: ./fixtures/a.js?a=1,
			          resolvedModule: ./fixtures/a.js?a=1,
			          resolvedModuleId: 133,
			          resolvedModuleIdentifier: <TEST_ROOT>/fixtures/a.js?a=1,
			          type: cjs self exports reference,
			          userRequest: self,
			        },
			        Object {
			          active: true,
			          explanation: undefined,
			          loc: undefined,
			          moduleId: 305,
			          moduleIdentifier: <TEST_ROOT>/fixtures/abc-query.js,
			          moduleName: ./fixtures/abc-query.js,
			          resolvedModule: ./fixtures/abc-query.js,
			          resolvedModuleId: 305,
			          resolvedModuleIdentifier: <TEST_ROOT>/fixtures/abc-query.js,
			          type: cjs export require,
			          userRequest: ./a?a=1,
			        },
			      ],
			      size: 55,
			      sizes: Object {
			        javascript: 55,
			      },
			      source: module.exports = function a() {
				return "This is a";
			};,
			      type: module,
			      usedExports: null,
			      warnings: 0,
			    },
			    Object {
			      assets: Array [],
			      buildTimeExecuted: false,
			      built: true,
			      cacheable: true,
			      cached: false,
			      chunks: Array [
			        889,
			      ],
			      codeGenerated: true,
			      dependent: undefined,
			      depth: 1,
			      errors: 0,
			      failed: false,
			      filteredReasons: undefined,
			      id: 679,
			      identifier: <TEST_ROOT>/fixtures/c.js?c=3,
			      index: 2,
			      index2: 2,
			      issuer: <TEST_ROOT>/fixtures/abc-query.js,
			      issuerId: 305,
			      issuerName: ./fixtures/abc-query.js,
			      issuerPath: Array [
			        Object {
			          id: 305,
			          identifier: <TEST_ROOT>/fixtures/abc-query.js,
			          name: ./fixtures/abc-query.js,
			        },
			      ],
			      layer: undefined,
			      moduleType: javascript/auto,
			      name: ./fixtures/c.js?c=3,
			      nameForCondition: <TEST_ROOT>/fixtures/c.js,
			      optimizationBailout: Array [
			        Statement with side_effects in source code at ./fixtures/c.js?c=3<LINE_COL_RANGE>,
			        ModuleConcatenation bailout: Module is not an ECMAScript module,
			      ],
			      optional: false,
			      orphan: false,
			      postOrderIndex: 2,
			      preOrderIndex: 2,
			      providedExports: null,
			      reasons: Array [
			        Object {
			          active: true,
			          explanation: undefined,
			          loc: undefined,
			          moduleId: 305,
			          moduleIdentifier: <TEST_ROOT>/fixtures/abc-query.js,
			          moduleName: ./fixtures/abc-query.js,
			          resolvedModule: ./fixtures/abc-query.js,
			          resolvedModuleId: 305,
			          resolvedModuleIdentifier: <TEST_ROOT>/fixtures/abc-query.js,
			          type: cjs export require,
			          userRequest: ./c?c=3,
			        },
			        Object {
			          active: true,
			          explanation: undefined,
			          loc: undefined,
			          moduleId: 679,
			          moduleIdentifier: <TEST_ROOT>/fixtures/c.js?c=3,
			          moduleName: ./fixtures/c.js?c=3,
			          resolvedModule: ./fixtures/c.js?c=3,
			          resolvedModuleId: 679,
			          resolvedModuleIdentifier: <TEST_ROOT>/fixtures/c.js?c=3,
			          type: cjs self exports reference,
			          userRequest: self,
			        },
			      ],
			      size: 72,
			      sizes: Object {
			        javascript: 72,
			      },
			      source: module.exports = function b() {
				require("./a");
				return "This is c";
			};,
			      type: module,
			      usedExports: null,
			      warnings: 0,
			    },
			    Object {
			      assets: Array [],
			      buildTimeExecuted: false,
			      built: true,
			      cacheable: true,
			      cached: false,
			      chunks: Array [
			        889,
			      ],
			      codeGenerated: true,
			      dependent: undefined,
			      depth: 2,
			      errors: 0,
			      failed: false,
			      filteredReasons: undefined,
			      id: 195,
			      identifier: <TEST_ROOT>/fixtures/a.js,
			      index: 3,
			      index2: 1,
			      issuer: <TEST_ROOT>/fixtures/c.js?c=3,
			      issuerId: 679,
			      issuerName: ./fixtures/c.js?c=3,
			      issuerPath: Array [
			        Object {
			          id: 305,
			          identifier: <TEST_ROOT>/fixtures/abc-query.js,
			          name: ./fixtures/abc-query.js,
			        },
			        Object {
			          id: 679,
			          identifier: <TEST_ROOT>/fixtures/c.js?c=3,
			          name: ./fixtures/c.js?c=3,
			        },
			      ],
			      layer: undefined,
			      moduleType: javascript/auto,
			      name: ./fixtures/a.js,
			      nameForCondition: <TEST_ROOT>/fixtures/a.js,
			      optimizationBailout: Array [
			        Statement with side_effects in source code at ./fixtures/a.js<LINE_COL_RANGE>,
			        ModuleConcatenation bailout: Module is not an ECMAScript module,
			      ],
			      optional: false,
			      orphan: false,
			      postOrderIndex: 1,
			      preOrderIndex: 3,
			      providedExports: null,
			      reasons: Array [
			        Object {
			          active: true,
			          explanation: undefined,
			          loc: undefined,
			          moduleId: 195,
			          moduleIdentifier: <TEST_ROOT>/fixtures/a.js,
			          moduleName: ./fixtures/a.js,
			          resolvedModule: ./fixtures/a.js,
			          resolvedModuleId: 195,
			          resolvedModuleIdentifier: <TEST_ROOT>/fixtures/a.js,
			          type: cjs self exports reference,
			          userRequest: self,
			        },
			        Object {
			          active: true,
			          explanation: undefined,
			          loc: 2:12-17,
			          moduleId: 679,
			          moduleIdentifier: <TEST_ROOT>/fixtures/c.js?c=3,
			          moduleName: ./fixtures/c.js?c=3,
			          resolvedModule: ./fixtures/c.js?c=3,
			          resolvedModuleId: 679,
			          resolvedModuleIdentifier: <TEST_ROOT>/fixtures/c.js?c=3,
			          type: cjs require,
			          userRequest: ./a,
			        },
			      ],
			      size: 55,
			      sizes: Object {
			        javascript: 55,
			      },
			      source: module.exports = function a() {
				return "This is a";
			};,
			      type: module,
			      usedExports: null,
			      warnings: 0,
			    },
			  ],
			  namedChunkGroups: Object {
			    main: Object {
			      assets: Array [
			        Object {
			          name: main.js,
			          size: 337,
			        },
			      ],
			      assetsSize: 337,
			      auxiliaryAssets: Array [],
			      auxiliaryAssetsSize: 0,
			      childAssets: Object {},
			      children: Object {},
			      chunks: Array [
			        889,
			      ],
			      filteredAssets: 0,
			      isOverSizeLimit: false,
			      name: main,
			    },
			  },
			  outputPath: <TEST_ROOT>/dist,
			  publicPath: auto,
			  warnings: Array [],
			  warningsCount: 0,
			}
		`);
	}
};
